/*
 *******************************************************************************
 *                                EIT CarLib
 *                             lib FUNCTIONS
 *
 *                     (c) Copyright 2015-2020 Car@EIT 
 *                            All Rights Reserved
 * File      : EIT_Motor.h
 * This file is part of EIT Car Project
 * Embedded Innovation Team(EIT) - Car@EIT  
 * ----------------------------------------------------------------------------
 * LICENSING TERMS:
 * 
 *     CarLib is provided in source form for FREE evaluation and  educational 
 * use.
 *    If you plan on using  EITLib  in a commercial product you need to contact 
 * Car@EIT to properly license its use in your product. 
 * 
 * ----------------------------------------------------------------------------
 * Change Logs:
 * Date           Author       Notes
 * 2015-01-24     Xian.Chen    the first version
 *
 *******************************************************************************
 */

#ifndef __CARLIB_MOTOR2FB_DEF__
#define __CARLIB_MOTOR2FB_DEF__
#include "common.h"
#include "include.h"
//typede enum  {MOTOR_STOP,MOTOR_BRAKE,MOTOR_TURNING} MotorMode_e;
#define    MOTOR1_PWM_FREQ  1000
#define    MOTOR1_PWM_MAX FTM0_PRECISON
#define    MOTOR1_PWM_MIN (-FTM0_PRECISON)
#define    MOTOR1_FTM    FTM0
#define    MOTOR1_EN     PTD3
#define    MOTOR1_PWMA   FTM_CH4
#define    MOTOR1_PWMB   FTM_CH5

#define    MOTOR2_PWM_FREQ  1000
#define    MOTOR2_PWM_MAX FTM0_PRECISON
#define    MOTOR2_PWM_MIN (-FTM0_PRECISON)
#define    MOTOR2_FTM    FTM0
#define    MOTOR2_EN     PTD8 
#define    MOTOR2_PWMA   FTM_CH6
#define    MOTOR2_PWMB   FTM_CH7

void Motor1_init(void);
void Motor1_Start(int32 pwm);
void Motor1_Brake(void);
void Motor1_Slip(void);

void Motor2_init(void);
void Motor2_Start(int32 pwm);
void Motor2_Brake(void);
void Motor2_Slip(void);

#endif